{extend name="Public:base"/}

{block name="main"}
<div class="box-info">
    <table class="table table-bordered">
        <thead>
        <tr>
            <td>名称</td>
            <td>大小</td>
            <td>上传时间</td>
            <td>操作</td>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo" key="k"}
        <tr class=" attachment">
            <td>{$vo['filename']}</td>
            <td>{$vo['filesize']}</td>
            <td>{$vo['create_time']|toDate=###,'Y-m-d'}</td>
            <td>
                <a class="btn btn-sm btn-primary" href="{:U('Attachment/edit','aid='.$vo['aid'])}">编辑</a>
                <a class="btn btn-sm btn-danger" href="{:U('Attachment/delete','aid='.$vo['aid'])}">删除</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>

    <div class="pagination">{$page}</div>
</div>
{/block}

{block name="script"}
{load href="__STATIC__/laydate/laydate.js"/}
<script>

    laydate.render({
        elem: '#start',
        format: 'YYYY/MM/DD hh:mm:ss',
//    min: laydate.now(), //设定最小日期为当前日期
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function(datas){
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    });

    laydate.render({
        elem: '#end',
        format: 'YYYY/MM/DD hh:mm:ss',
        min: laydate.now(),
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function(datas){
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    });

</script>
{/block}
